﻿#ifndef FSINGLELINEEDITDIALOG_H
#define FSINGLELINEEDITDIALOG_H

#include "../Base/FDialog.h"
#include "../FEdits/FLineEdit.h"
#include <QRegExpValidator>


namespace Ui {
class FSingleLineEditDialog;
}

class FSingleLineEditDialog : public FDialog
{
    Q_OBJECT

public:
    explicit FSingleLineEditDialog(QWidget *parent = nullptr);
    ~FSingleLineEditDialog();

    static QString getString(QWidget* parent, const QString& title, const QString& tip, const QString& defaultVal="", QRegExpValidator* validator=nullptr);
    static int getInt(QWidget* parent, const QString& title, const QString& tip, const int defaultVal=-1, bool* ok=nullptr);

    static QStringList getStrings(QWidget* parent, const QString& title, const QStringList& tips, const QStringList& defaultVals=QStringList());

protected:
    FLineEdit* addEdit(const QString& tip, const QString& defaultVal="");

private slots:
    void on_btnConfirm_clicked();

    void on_btnCancel_clicked();

private:
    Ui::FSingleLineEditDialog *ui;
};

#endif // FSINGLELINEEDITDIALOG_H
